<?php echo $this->Session->flash(); ?>
<script>

    $(document).ready(function() {
        $('#tabla').dataTable( {
            
            "bPaginate": false,
            "bSort": false,
            "bInfo": false



        })
    
    
    })
</script>






<?php
$paginator->options(array('update' => 'content', 'indicator' => 'loading'));
?>


<br>
<br>
<table >
<tbody>
    <tr>
        <td colspan="2">
            <?php
            echo $paginator->counter(array(
                'format' => 'Página %page% de %pages%, Mostrando %current% registros de %count% totales, empezando en %start%, terminando en %end%'
                    )
            );
            ?> 
        </td>
    </tr>
</table>

</tbody>
<div class="paging">
    <?php
    echo $this->Paginator->options(array('update' => '#content', 'evalScripts' => false));
    echo $this->Paginator->prev('< ' . __('Anterior'), array(), null, array('class' => 'prev disabled'));
    echo $this->Paginator->numbers(array('separator' => ''));
    echo $this->Paginator->next(__('Siguiente') . ' >', array(), null, array('class' => 'next disabled'));
    ?>
</div>
<br><br>

<table id="tabla">
    <thead >
        <tr>
            <th><?php echo $paginator->sort( 'Código','Proyect.codigo'); ?></th>
            <th><?php echo $paginator->sort( 'Username','User.username'); ?></th>
            <th><?php echo $paginator->sort( 'Nombre','User.nombre'); ?></th>
            <th><?php echo $paginator->sort( 'Apellido','User.primer_apellido'); ?></th>
            <th><?php echo $paginator->sort( 'Grupo','Group.name'); ?></th>
            <th></th>
            
        </tr>
    </thead>
    <tbody>
        <?php foreach ($proyects as $pro): ?>
            
            <tr >
                <td ><?php echo $pro['Proyect']['codigo'] ?></td>
                <td ><?php echo $pro['User']['username'] ?></td>
                <td ><?php echo $pro['User']['nombre'] ?></td>
                <td ><?php echo $pro['User']['primer_apellido'] ?></td>
                <td ><?php echo $pro['Group']['name'] ?></td>
                <td><?php echo $ajax->link($html->image("delete.png", array('width' => '30', 'heigth' => '30', 'alt' => 'Eliminar')), array('controller' => "UserProyects", "action" => "delete", $pro['UserProyect']['id']), array('escape' => false, 'update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading'), '¿Esta seguro de eliminar esta asignación? ') ?></td>

            </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<?php echo $this->Js->writeBuffer(); ?>

